Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

random-seed

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-seed

GRC's UHE PRNG in node (Ultra-High Entropy Pseudo-Random Number Generator by Gibson Research Corporation)

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
175K
increased by3.49%
Maintainers
1
Weekly downloads
 
Created

What is random-seed?

The random-seed npm package is used to generate random numbers based on a seed value. This allows for reproducible random number sequences, which can be useful in scenarios like testing, simulations, and procedural content generation.

What are random-seed's main functionalities?

Seeded Random Number Generation

This feature allows you to create a random number generator that produces the same sequence of random numbers for a given seed. This is useful for reproducibility in tests and simulations.

const randomSeed = require('random-seed');
const seed = 'my-seed';
const rand = randomSeed.create(seed);
console.log(rand.random()); // Generates a random number based on the seed

Random Integer Generation

This feature allows you to generate a random integer within a specified range, based on the seed. This can be useful for scenarios where you need random but reproducible integers.

const randomSeed = require('random-seed');
const seed = 'my-seed';
const rand = randomSeed.create(seed);
console.log(rand.intBetween(1, 100)); // Generates a random integer between 1 and 100 based on the seed

Random Float Generation

This feature allows you to generate a random floating-point number within a specified range, based on the seed. This can be useful for simulations and procedural content generation.

const randomSeed = require('random-seed');
const seed = 'my-seed';
const rand = randomSeed.create(seed);
console.log(rand.floatBetween(0, 1)); // Generates a random float between 0 and 1 based on the seed

Other packages similar to random-seed

Keywords

FAQs

Package last updated on 01 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc